import 'package:flutter/material.dart';

/**
 * ListView.separated
 * 下划线
 */
class ListWidget03 extends StatelessWidget {
  const ListWidget03({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xffff0000),
        title: Text('ListView.build'),
      ),
      body: ListView.separated(
        ///item设置
        itemBuilder: (BuildContext context, int index) {
          return Text(
            'ListView.separated itemBuilder',
            style: TextStyle(fontSize: 20),
          );
        },

        ///分割线设置
        separatorBuilder: (BuildContext context, int index) {
          return Divider(
            color: Colors.red,
            height: 50,
            endIndent: 10,
          );
        },
        itemCount: 20,
      ),
    );
  }
}
